
package com.tool.btn;

import com.tool.PanelDisplay.RolePanelShow;
import com.tool.image.ImageMixDeal;
import com.tool.imagemonitor.NpcMonitor;
import com.tool.role.RoleData;
import com.tool.tcp.GetTcpPath;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import org.cbg.bean.SearchGoodsBean;
import org.cbg.frame.TrslationMainJframe;
import org.come.Frame.*;
import org.come.Jpanel.GiveJpanel;
import org.come.Jpanel.ZhshuanfutujianJpanel;
import org.come.Jpanel.ZhuJpanel;
import org.come.action.MapAction;
import org.come.bean.ApplyQianDao;
import org.come.bean.ConfigureBean;
import org.come.bean.GoodSEarchBean;
import org.come.bean.LaborRank;
import org.come.daily.JframeDailyMain;
import org.come.entity.Baby;
import org.come.model.Configure;
import org.come.model.Shop;
import org.come.mouslisten.HotKeyMouseListen;
import org.come.setup.XSeTupJpanelxsjm;
import org.come.shortcut.XBjczJpanelxsjm;
import org.come.socket.Agreement;
import org.come.socket.DownLoadTxt;
import org.come.socket.SendMessageUntil;
import org.come.summonequip.JframeCashRewardsMain;
import org.come.until.*;
import org.lottery.frame.LotteryMainFrame;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;



public class FormsOnOffBtn extends MoBanBtn {
    private static final long serialVersionUID = 7822149256715030997L;
    private final int formsid;
    private int x;
    private int y;
    private String text;
    private boolean is;
    private ScriptObjectMirror npcmenuAction;

    public FormsOnOffBtn(String iconpath, int type, int id) {
        super(iconpath, type);
        this.formsid = id;
    }


    public FormsOnOffBtn(String iconpath, int type, Color[] colors, String text, int id) {
        super(iconpath, type, colors);
        this.formsid = id;
        this.text = text;
        setFont(UIUtils.TEXT_HY166);
//        File file = new File(iconpath);
//
//        try {
//            BufferedImage src = ImageIO.read(file);
//
//            int destWidth = src.getWidth();
//            int destHeight = src.getHeight() / 3;
//	        this.x = (destWidth - 12) / 2;
//	        this.y = destHeight / 2 + 3;
//            //int destHeight = src.getHeight() / 3;
//            //this.x = (destWidth - 25) / 2;
//           // this.y = destHeight / 1  -3;
//        } catch (IOException var10) {
//            var10.printStackTrace();
//        }
//
        this.setText(text);
        setVerticalTextPosition(SwingConstants.CENTER);
        setHorizontalTextPosition(SwingConstants.CENTER);
   /*     super(iconpath, type, colors);
        this.formsid = id;
        this.text = text;
        File file = new File(iconpath);

        try {
            BufferedImage src = ImageIO.read(file);

            int destWidth = src.getWidth();
            int destHeight = src.getHeight() / 3;
            this.x = (destWidth - 12) / 2;
            this.y = destHeight / 2 + 3;
            //int destHeight = src.getHeight() / 3;
            //this.x = (destWidth - 25) / 2;
            // this.y = destHeight / 1  -3;
        } catch (IOException var10) {
            var10.printStackTrace();
        }*/


    }
    private ZhshuanfutujianJpanel jpanel4;
    public FormsOnOffBtn(String iconpath, int type, Color[] colors, Font font, String text, int id, ZhshuanfutujianJpanel jpanel4) {
        super(iconpath, type, colors);
        this.formsid = id;
        this.text = text;
        this.setFont(UIUtils.TEXT_HY17);
        setForeground(Color.black);
        this.jpanel4 = jpanel4;
//        if ("水墨UI".equals(MyIsif.getStyle())) {
        setFont(font);
        File file = new File(iconpath);
        try {
            BufferedImage src = ImageIO.read(file);

            int destWidth = src.getWidth();
            int destHeight = src.getHeight() / 3;
            this.x = (destWidth - 12) / 3;
            this.y = destHeight / 2 + 5;
        } catch (IOException var10) {
            var10.printStackTrace();
        }
//        } else {
//            setFont(font);
//            File file = new File(iconpath);
//            try {
//                BufferedImage src = ImageIO.read(file);
//
//                int destWidth = src.getWidth();
//                int destHeight = src.getHeight() / 3;
//                this.x = (destWidth - 12) / 5;
//                this.y = destHeight / 2 + 5;
//            } catch (IOException var10) {
//                var10.printStackTrace();
//            }
//        }
    }


    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

//        if (this.text != null) {
//            g.setFont(UIUtils.TEXT_FONT1);
//            g.setColor();
//            if (this.type == 2) {
//                g.drawString(this.text, this.x + 1, this.y + 1);
//            } else {
//                g.drawString(this.text, this.x, this.y);
//            }
//        }
        /*if (this.text != null) {
            if(jpanel2 !=null || jpanel3 != null|| jpanel4 != null){
                g.setFont(UIUtils.TEXT_FONT2);
            } else {
                g.setFont(UIUtils.TEXT_FONT);
            }

//            g.setColor(this.colors[this.type]);
            if (this.type == 2) {
                g.drawString(this.text, this.x + 1, this.y + 1);
            } else {
                g.drawString(this.text, this.x, this.y);
            }
        }*/
    }


    @Override
    public void chooseyes() {
    }

    @Override
    public void chooseno() {
    }

    @Override
    public void nochoose(MouseEvent e) {
        if (FormsManagement.getInternalForm3(this.formsid) == null) {
            switch(this.formsid) {
                case 0:
                    RolePanelShow.Show();
                    break;
                case 1:
                    Baby baby = UserMessUntil.getbaby(TestChildJframe.getTestChildJframe().getTestChildJpanel().getBabyid());
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().ShowBaby(baby);
                    FormsManagement.showForm(1);
                    break;

                case 2999:
                    this.complainOpenWeb();

                    break;

                case 3100:

                    XBjczJpanelxsjm.getXBjczJpanelxsjm().getXBjczJpanel();
                    FormsManagement.showForm(3100);
                    break;
                case 3102:
                    XSeTupJpanelxsjm.getXSeTupJpanelxsjm().getXSeTupJpanel();
                    FormsManagement.showForm(3102);
                    break;

                case 3103:
//                  MapAction.npcmenuAction.get(NpcMenuUntil.getCurerolesumming()).menuControl("开启桃源仙境");
                    String npctype1 = "521";
                    String sendmes1 = Agreement.getAgreement().gangmonitor(npctype1+"");
                    SendMessageUntil.toServer(sendmes1);


                    break;

                case 2:
                    ZhuJpanel.setUseGoodsType(0);
                    FormsManagement.showForm(2);
                    break;
                case 3:
                    FormsManagement.showForm(3);
                    TesttaskJframe.getTesttaskJframe().getJtask().showTaskMethod();
                    break;
                case 4:
                    MessagrFlagUntil.ReceiveFriend();
                    break;
                case 5:
                    String oneArenaSendmes = Agreement.getAgreement().oneArenaAgreement("1");
                    SendMessageUntil.toServer(oneArenaSendmes);
                    break;
                case 7:
                    String sendmes = Agreement.getAgreement().MountAgreement();
                    SendMessageUntil.toServer(sendmes);
                    break;
                case 22:
                    TestsmallmapJframe.getTestsmallmapJframe().setLocation((ScrenceUntil.Screen_x / 2 - Util.mapmodel.getMin_x() / 2)-41, (ScrenceUntil.Screen_y / 2 - Util.mapmodel.getMin_y() / 2)-20);
                    FormsManagement.showForm(this.formsid);
                    break;
                case 4001:
                    FormsManagement.showForm(36);
                    break;
                case 4000:
                    FormsManagement.showForm(700);
                    break;

                case 400:
                    if (FormsManagement.getInternalForm2(400) != null) {
                        InstanceXJframe.getInstanceXJframe().getInstanceXJpanel().refreshView();
                    }

                    FormsManagement.showForm(this.formsid);
                    break;
                case 77:
                    List<Shop> npcshop = UserMessUntil.getNpcshop().getNpcShopMap().get("88");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop, "88", null);
                    FormsManagement.showForm(23);
                    break;
                case 48:
                    Show();
                    break;
                case 60:
                    String mes = Agreement.getAgreement().pankinglistAgreement("1");
                    SendMessageUntil.toServer(mes);
                    break;
                case 78:

                    /** 展示藏宝阁窗口 */
                    if(FormsManagement.getInternalForm2(78) == null){

                        FormsManagement.showForm(78);


                    }else{
                        if(!FormsManagement.getframe(78).isVisible()){


                            FormsManagement.showForm(78);
                        }
                    }
                    /**
                     * 向服务器获取最新上架的物品信息 1、初始化协议 2、修改搜索类型(0、首页最新上架页面 1、首页 2、大话币 3、道具 4、召唤兽
                     * 5、装备 6、灵宝 7、公示期 8、收藏 9、我要卖之已寄售品) 3、当前页码(默认为1) 4、转换为json字符串
                     * 5、上传给服务器
                     */
                    SearchGoodsBean searchGoodsBean = new SearchGoodsBean();
                    searchGoodsBean.setSaletype(1);
                    searchGoodsBean.setPageNum(1);
                    String msg = Agreement.getAgreement().searchGoodsAgreement(
                            GsonUtil.getGsonUtil().getgson().toJson(searchGoodsBean));
                    SendMessageUntil.toServer(msg);
                    TrslationMainJframe.getTrslationMainJframe().setPanelOpen(0);

                    break;
                case 79://翅膀商店
                    if (!FormsManagement.getframe(23).isVisible()) {

                        List<Shop> npcshop1 = UserMessUntil.getNpcshop().getNpcShopMap().get("5");
                        ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop1, "5", null);
                        FormsManagement.showForm(23);
                    } else {
                        FormsManagement.HideForm(23);
                    }
                    break;
                case 80:
                    MapAction.npcmenuAction.get(NpcMenuUntil.getCurerolesumming()).menuControl("治疗所有");
                    break;
                case 81:
                    NPCJfram.getNpcJfram().getNpcjpanel().shuangbeijingyan();
                    break;
                case 83:
                    MapAction.npcmenuAction.get(NpcMenuUntil.getMenu9()).menuControl("我要住店(扣除2000银两)");
                    break;
                case 82:
                    MapAction.npcmenuAction.get(NpcMenuUntil.DBEXP).menuControl("我要冻结双倍时间");
                    break;
                case 87:
                    LotteryMainFrame.getLotteryMainFrame().getLotteryMainPanel().getlotteryTypeGoods(1);
                    FormsManagement.showForm(87);
                    break;
                case 88:
                    System.exit(0);
                    break;
                case 89:
                    GoodSEarchBean goods = new GoodSEarchBean();
                    goods.setType(0);
                    goods.setGoodname(null);
                    String sendmes9 = Agreement.getAgreement().GOODSFORGOODSAPPLYAgreement(GsonUtil.getGsonUtil().getgson().toJson(goods));
                    SendMessageUntil.toServer(sendmes9);
                    FormsManagement.showForm(90);
                    break;
                case 91:
                    STRTMP();
                    break;
                case 92:
//                 密码输入打开勇者兑换
//                    if(Util.isCanBuyOrno()){
//                        return;
//                    }
                    JframeCashRewardsMain.getJframeCashRewardsMain().getJpanelCashRewardsMain().setGoodsType(3);
                    FormsManagement.showForm(92);
                    break;

                case 920://比斗兑换
//                 密码输入打开比斗奖章
//                    if(Util.isCanBuyOrno()){
//                        return;
//                    }
                    JframeCashRewardsMain.getJframeCashRewardsMain().getJpanelCashRewardsMain().setGoodsType(1);
                    FormsManagement.showForm(92);
                    break;
                case 111:
                    DreamlandTrialMainJframe.getDreamlandTrialMainJframe().getDreamlandTrialMainJpanel().showLvlTier(1);
                    FormsManagement.showForm(111);
                    return;
                case 125://成圣窗口调用
                    ApplyQianDao applyQianDao = new ApplyQianDao();
                    applyQianDao.setType(1);
                    String sendmes10 = Agreement.getAgreement().APPQIANDAOAgreement(GsonUtil.getGsonUtil().getgson().toJson(applyQianDao));
                    SendMessageUntil.toServer(sendmes10);
                    FormsManagement.showForm(125);
                    break;
                case 90:
                    JframeDailyMain.getJframeDailyMain().getJpanelDailyMain().getEventMap(-1);
                    FormsManagement.showForm(90);
                    break;
                case 99://改手机号码
                    FormsManagement.showForm(99);
                    IphoneVerifyFrame.getIphoneVerifyFrame().getIphoneVerifyPanel().changeMenu(-1);
                    break;
                case 105://伙伴装备调用
                    PartnerJframe.getPartnerJframe().getPartnerMainJpanel().addPartnerUnit();
                    break;
                case 801://杂货铺调用
                    String npctype = "5";
                    List<Shop> npcshop11 = UserMessUntil.getNpcshop().getNpcShopMap().get(npctype);
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop11, npctype, null);
                    FormsManagement.showForm(23);
                    break;
                case 802:
                    GiveJpanel giveJpanel = GiveJframe.getGivejframe().getGivejpanel();
                    if (FormsManagement.getframe(12).isVisible()) {
                        ZhuFrame.getZhuJpanel().addPrompt("您当前状态不可操作,请稍后再试！");
                        return;
                    }

                    giveJpanel.giveShow(ImageMixDeal.getNpc("400256"));
                    break;
                //case 803:
                //OptionsJframe.getOptionsJframe().getOptionsJpanel().showBox(TiShiUtil.ClearAllGood, (Object)null, "#W此功能为#R一键清包#W，会将#Y当前打开的物品栏#W中的非加锁物品全部丢弃，你确定要这么操作吗? #R（注意，物品丢弃后无法找回！）");
                // break;
                case 804:
                    GoodsListFromServerUntil.zhengli();
                    return;
                case 985:
                    if (!FormsManagement.getframe(52).isVisible()) {

                        FormsManagement.showForm(52);
                    } else {
                        FormsManagement.HideForm(52);
                    }
                    break;
                case 85:
                    NPCJfram.getNpcJfram().getNpcjpanel().baoshi();
                    return;
                case 805:
                    DDGoodUntil.zhengli();
                    return;
                case 999 :
                    NPCJfram.getNpcJfram().getNpcjpanel().anniutanchuang();
                    break;
                case 1024 :
                    NPCJfram.getNpcJfram().getNpcjpanel().dangpu();
                    break;
                case 1025 :
                    NPCJfram.getNpcJfram().getNpcjpanel().wupinduihuan();
                    break;
                case 1026 :
                    NPCJfram.getNpcJfram().getNpcjpanel().yiyuan();
                    break;
                case 1100:
                    SendMessageUntil.toServer(Agreement.getAgreement().qdAgreement("open"));
                    break;
                case 1101:
                    ChaojifeiJframe.getChaojifeiListJpanel();
                    FormsManagement.showForm(1101);
                    break;
                case 1102://任我行
                    WorldMapJframe.getWorldMapJpanel();
                    FormsManagement.showForm(1102);
                    break;
                case 1103:
                    WorldTestsmallmapJframe.getWorldTestsmallmapJpanel();
                    FormsManagement.showForm(1103);
                    break;
                case 1104:
                    EventCalendarJframe.getEventCalendarJpanel();
                    FormsManagement.showForm(1104);
                    break;
                case 1105://全民竞猜
                    SendMessageUntil.toServer(Agreement.getAgreement().LotteryCPAgreement("QPEN"));
                    FormsManagement.showForm(1105);
                    break;
                case 2000:
                    GMshopJframe.getGMshopJpanel();
                    FormsManagement.showForm(2000);
                    break;
                case 3000:
                    FormsManagement.showForm(3000);
                    break;
                case 3001:
                    AthChartJframe.getAthChartJPanel();
                    FormsManagement.showForm(3001);
                    LaborRank laborRank = new LaborRank();
                    laborRank.setRank(11);
                    laborRank.setValue1("");
                    AthChartJframe.getAthChartJPanel().showViewData(laborRank);
                    break;
                case 3002:
                    RechargeVIPJframe.getRechargeVIPJpanel();
                    FormsManagement.showForm(3002);
                    RechargeVIPJframe.getRechargeVIPJpanel().getShop();
                    break;
                case 3003:
                    FormsManagement.showForm(3003);
                    break;
//                 case 119:
//                	 AircraftJframe.getActivityJframe();
//                	 FormsManagement.showForm(119);
//                	 break;

                case 120:
                    List<Shop> npcshop1 = UserMessUntil.getNpcshop().getNpcShopMap().get("120");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop1, "120", null);
                    FormsManagement.showForm(23);
                    break;
                case 121:
                    List<Shop> npcshop121 = UserMessUntil.getNpcshop().getNpcShopMap().get("121");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop121, "121", null);
                    FormsManagement.showForm(23);
                    break;
                case 123:
                    List<Shop> npcshop123 = UserMessUntil.getNpcshop().getNpcShopMap().get("123");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop123, "123", null);
                    FormsManagement.showForm(23);
                    break;
                case 126:
                    List<Shop> npcshop126 = UserMessUntil.getNpcshop().getNpcShopMap().get("126");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop126, "126", null);
                    FormsManagement.showForm(23);
                    break;
                case 127:
                    List<Shop> npcshop127 = UserMessUntil.getNpcshop().getNpcShopMap().get("2029");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop127, "2029", null);
                    FormsManagement.showForm(23);
                    break;
                case 623:
                    FormsManagement.HideForm(623);
                    break;
                case 128:
                    List<Shop> npcshop128 = UserMessUntil.getNpcshop().getNpcShopMap().get("605");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop128, "605", null);
                    FormsManagement.showForm(23);
                    break;
                case 129:
                    List<Shop> npcshop129 = UserMessUntil.getNpcshop().getNpcShopMap().get("89");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop129, "89", null);
                    FormsManagement.showForm(23);
                    break;
                case 130:
                    List<Shop> npcshop130 = UserMessUntil.getNpcshop().getNpcShopMap().get("88");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop130, "88", null);
                    FormsManagement.showForm(23);
                    break;
                case 131:
                    List<Shop> npcshop131 = UserMessUntil.getNpcshop().getNpcShopMap().get("9");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop131, "9", null);
                    FormsManagement.showForm(23);
                    break;
                case 132:
                    List<Shop> npcshop132 = UserMessUntil.getNpcshop().getNpcShopMap().get("15");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop132, "15", null);
                    FormsManagement.showForm(23);
                    break;
                case 133:
                    List<Shop> npcshop133 = UserMessUntil.getNpcshop().getNpcShopMap().get("13");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop133, "13", null);
                    FormsManagement.showForm(23);
                    break;
                case 134:
                    List<Shop> npcshop134 = UserMessUntil.getNpcshop().getNpcShopMap().get("2025");
                    ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().showshop(npcshop134, "2025", null);
                    FormsManagement.showForm(23);
                    break;
                case 600:
                    FindDropJfram.getFindDropJfram().getFindDropJpanel();
                    FormsManagement.showForm(600);
                    break;
                case 994 :
                    NPCJfram.getNpcJfram().getNpcjpanel().pspytanchuang();
                    break;
                case 995 :
                    NPCJfram.getNpcJfram().getNpcjpanel().bshctanchuang();
                    break;
                case 996 :
                    NPCJfram.getNpcJfram().getNpcjpanel().xqhctanchuang();
                    break;
                case 997 :
                    NPCJfram.getNpcJfram().getNpcjpanel().sbsjtanchuang();
                    break;
                case 998 :
                    NPCJfram.getNpcJfram().getNpcjpanel().sbdztanchuang();
                    break;
                case 1000 :
                    NPCJfram.getNpcJfram().getNpcjpanel().zhshuanfu();
                    break;
                case 9999:
                    RoleData roleData = RoleData.getRoleData();
                    roleData.addHelpBb(roleData.getHelpBbId());
                    SupportListJframe.getSupportListJframe().getSupportListJpanel().init(roleData.getHelpBbName(roleData.getHelpBb()));
                    FormsManagement.showForm(62);
                    break;

                case 887:
                    MapAction.npcmenuAction.get(NpcMenuUntil.getMenu18()).menuControl("我已做好了转生准备");
                    break;

                case 888:
                    try {
                        if(HotKeyMouseListen.isHide){
                            if("水墨UI".equals(MyIsif.getStyle())) {
                                ZhuFrame.getZhuJpanel().getHotKey().setIcons(CutButtonImage.cuts("skin/8100226/newbutton/kjlsxaj.png"));
                            }else{
                                ZhuFrame.getZhuJpanel().getHotKey().setIcons(CutButtonImage.cuts("skin/8100226/newbutton/kjlsxajh.png"));
                            }
                            ZhuJpanel.getHotKey().setBounds(ScrenceUntil.Screen_x-333, ScrenceUntil.Screen_y - 79, 14, 37);

                            ZhuFrame.getZhuJpanel().showHotKey();
//                        ZhuFrame.getZhuJpanel().getHotKeyBack().setVisible(true);
                            HotKeyMouseListen.isHide = false;
                        }else{
                            if("水墨UI".equals(MyIsif.getStyle())) {
                                ZhuFrame.getZhuJpanel().getHotKey().setIcons(CutButtonImage.cuts("skin/8100226/newbutton/kjlkzaj.png"));
                            }else{
                                ZhuFrame.getZhuJpanel().getHotKey().setIcons(CutButtonImage.cuts("skin/8100226/newbutton/kjlkzajh.png"));
                            }
                            ZhuJpanel.getHotKey().setBounds(ScrenceUntil.Screen_x-12, ScrenceUntil.Screen_y - 79, 12, 37);

                            ZhuFrame.getZhuJpanel().hideHotKey();
//                        ZhuFrame.getZhuJpanel().getHotKeyBack().setVisible(false);
                            HotKeyMouseListen.isHide = true;
                        }
//                    HotKeyMouseListen.isHide = !HotKeyMouseListen.isHide;


                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                    break;
                case 806:
                    NpcMonitor.npc(ImageMixDeal.getNpc("300014"));
                    return;
                case 1117:
                    ApplyQianDao applyQianDao1 = new ApplyQianDao();
                    applyQianDao1.setType(1);
                    String sendmes11 = Agreement.getAgreement().APPQIANDAOAgreement(GsonUtil.getGsonUtil().getgson().toJson(applyQianDao1));
                    SendMessageUntil.toServer(sendmes11);
                    FormsManagement.showForm(1117);
                    break;

                default:
                    FormsManagement.showForm(this.formsid);
            }

            Music.addyinxiao("开关窗口.mp3");
        } else {
            if (this.formsid == 2) {
                ZhuJpanel.setUseGoodsType(0);
            }

            if (this.formsid == 14) {
                String send = Agreement.getAgreement().TransStateAgreement("2");
                SendMessageUntil.toServer(send);
            } else {
                if (this.formsid != 16 && this.formsid != 15) {
                    if (this.formsid == 47) {
                        ZhuJpanel.setNedangoods(null);
                    }
                } else {
                    FormsManagement.HideForm(this.formsid == 16 ? 15 : 16);
                }

                FormsManagement.HideForm(this.formsid);
                Music.addyinxiao("关闭窗口.mp3");
            }
        }
    }

    public static final int getProcessID() {
        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        return Integer.valueOf(runtimeMXBean.getName().split("@")[0]);
    }

    public static void STRTMP() {
        if("1".equals(GetTcpPath.STRTMP)) {
            GetTcpPath.STRTMP = "2";
            run("已切换为全屏法术！");
        }else {
            GetTcpPath.STRTMP = "1";
            run("已切换为非全屏法术!");
        }
    }
    /**
     * 联系客服
     */

    public void complainOpenWeb() {
        DownLoadTxt.getDownLoadTxt().initMes("configure.txt");
        ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
        Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
        Configure configure = item.get(new BigDecimal(1));
        String url = configure.getJumpurl();
        StringBuffer sb = new StringBuffer();
        sb.append(url);
        String stringParams = sb.toString();
        Desktop desktop = Desktop.getDesktop();
        try {
            desktop.browse(new URI(stringParams));
        } catch (IOException var7) {
            var7.printStackTrace();
        } catch (URISyntaxException var8) {
            var8.printStackTrace();
        }

    }
//    public void complainOpenWeb() {
//    	Map<String, Object> params = new HashMap<String, Object>();
//        params.put("roleName", ImageMixDeal.userimg.getRoleShow().getRolename());
//        params.put("roleAccount", RoleData.getRoleData().getLoginResult().getUserName());
//        params.put("roleQuid", GameClient.potAndIpStrings[5]);
//        String url = "http://www.dongmengzhongchou.com:80801/question";
//        StringBuffer sb = new StringBuffer();
//        sb.append(url);
//        sb.append("?");
//        if (params != null) {
//            Iterator var5 = params.entrySet().iterator();
//
//            while(var5.hasNext()) {
//                Entry<String, Object> e = (Entry)var5.next();
//                sb.append(e.getKey());
//                sb.append("=");
//                sb.append(e.getValue());
//                sb.append("&");
//            }
//
//            sb = sb.deleteCharAt(sb.length() - 1);
//        }
//
//        String stringParams = sb.toString();
//        Desktop desktop = Desktop.getDesktop();
//
//        try {
//            desktop.browse(new URI(stringParams));
//        } catch (IOException var7) {
//            var7.printStackTrace();
//        } catch (URISyntaxException var8) {
//            var8.printStackTrace();
//        }
//
//    }
    /**
     * 鼠标进入
     * @param e
     */
//     public void mouseEntered(MouseEvent e) {
//       MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
//     }
    /**
     * 鼠标离开
     * @param
     */
//    public void mouseExited(MouseEvent e) {
//        MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
//     }
    public static void Show() {
        if (ImageMixDeal.userimg.getRoleShow().getGang_id() != null && ImageMixDeal.userimg.getRoleShow().getGang_id().intValue() != 0) {
            if (FormsManagement.getframe(48).isVisible()) {
                FormsManagement.HideForm(48);
            } else {
                String senmes = Agreement.getAgreement().IntogangAgreement(ImageMixDeal.userimg.getRoleShow().getGang_id().toString());
                SendMessageUntil.toServer(senmes);
            }
        } else {
            ZhuFrame.getZhuJpanel().addPrompt2("你没有帮派!");
        }
    }
    public static void run(String type) {
        try {
            ZhuFrame.getZhuJpanel().addPrompt2(type);
        } catch (Exception e) {
            // TODO: handle exception
        }
    }
}
